package com.hsmw.api.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hsmw.api.mapper.HsmwBizUserMapper;
import com.hsmw.api.mapper.HsmwConcreteUserMapper;
import com.hsmw.api.mapper.HsmwUserMapper;
import com.hsmw.common.base.BaseService;
import com.hsmw.domain.HsmwConcreteUser;
import com.hsmw.domain.HsmwUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class HsmwConcreteUserService extends BaseService<HsmwConcreteUserMapper, HsmwConcreteUser> {


    @Autowired
    private HsmwConcreteUserMapper hsmwConcreteUserMapper;


    public HsmwConcreteUser findByUsername(String username) {
        QueryWrapper<HsmwConcreteUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(HsmwConcreteUser::getUsername, username);
        return hsmwConcreteUserMapper.selectOne(queryWrapper);
    }

}
